﻿<Page x:Class="PerspectiveDemo.Wpf3D.View.Space3DDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:p="http://www.codeplex.com/perspective"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="300"
    Style="{StaticResource PageStyle}"
	Title="Space3DDemo">
    <Page.Resources>
        <Style TargetType="Grid">
            <Setter Property="Width" Value="200" />
            <Setter Property="Height" Value="200" />
        </Style>
        <Style x:Key="BrushBorderStyle"  TargetType="Border">
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Padding" Value="22" />
        </Style>
        
        <SolidColorBrush x:Key="B00" Color="#FFFFFF"/>
        <SolidColorBrush x:Key="B10" Color="#28282A"/>
        <SolidColorBrush x:Key="B20" Color="#FFA500"/>
        <SolidColorBrush x:Key="B30" Color="#F5331F"/>
        <SolidColorBrush x:Key="B40" Color="#8CAE04"/>
        <SolidColorBrush x:Key="B41" Color="#75AE04"/>
        <SolidColorBrush x:Key="B42" Color="#317CC6"/>
        <SolidColorBrush x:Key="B50" Color="#F80606"/>
        <SolidColorBrush x:Key="B60" Color="#F81A06"/>
        <SolidColorBrush x:Key="B70" Color="#F82E06"/>
        <SolidColorBrush x:Key="B80" Color="#F84206"/>
        <SolidColorBrush x:Key="B90" Color="#F85706"/>
        <SolidColorBrush x:Key="B100" Color="#F86B06"/>
        <SolidColorBrush x:Key="B110" Color="#F87F06"/>

        <VisualBrush x:Key="LogoBrush" Stretch="UniformToFill">
            <VisualBrush.Visual>
                <Grid>
                    <Border 
                        Style="{StaticResource BrushBorderStyle}"
                        Background="{StaticResource B40}">
                        <Image Source="http://technodesign.solutions/Content/Sites/technodesign.solutions/Media/Images/logo.png" />
                    </Border>
                </Grid>
            </VisualBrush.Visual>
        </VisualBrush>
        
        <SpecularMaterial x:Key="Specular" SpecularPower="100.0" Brush="White"/>
        <MaterialGroup x:Key="SideMaterial">
            <DiffuseMaterial Brush="{StaticResource B20}"/>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>
        <MaterialGroup x:Key="SideMaterial2">
            <DiffuseMaterial Brush="{StaticResource B30}"/>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>
        <MaterialGroup x:Key="SideMaterial3">
            <DiffuseMaterial Brush="{StaticResource B40}"/>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>
        <MaterialGroup x:Key="LogoMaterial">
            <DiffuseMaterial Brush="{StaticResource LogoBrush}"/>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>
        <MaterialGroup x:Key="NewYear1Material">
            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B41}">
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        FontWeight="Bold"
                                        TextAlignment="Center"
                                        Foreground="{StaticResource B00}">
                                        <Run>Happy</Run>
                                        <LineBreak/>
                                        <Run>new year</Run>
                                        <LineBreak/>
                                        <Run>2015</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="NewYear2Material">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B40}">
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="{StaticResource B00}">
                                        <Run>May your</Run>
                                        <LineBreak/>
                                        <Run>software</Run>
                                        <LineBreak/>
                                        <Run>be...</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="SignMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B42}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="{StaticResource B00}">
                                        <LineBreak/>
                                        <Run FontSize="16">Olivier Dewit</Run>
                                        <LineBreak/>
                                        <Run FontSize="8">http://technodesign.solutions</Run>
                                        <LineBreak/>
                                        <Run FontSize="8">@wtechnodesigner</Run>
                                        <LineBreak/>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="InnoMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B100}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>innovative</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="AttractiveMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B90}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>attractive</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="RefMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                Style="{StaticResource BrushBorderStyle}"
                                Background="{StaticResource B70}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>visible</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="RoiMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B60}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>profitable</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="CompMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B80}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>responsive</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>

        <MaterialGroup x:Key="UsefulMaterial">

            <DiffuseMaterial >
                <DiffuseMaterial.Brush>
                    <VisualBrush Stretch="UniformToFill">
                        <VisualBrush.Visual>
                            <Grid>
                                <Border 
                                    Style="{StaticResource BrushBorderStyle}"
                                    Background="{StaticResource B110}"
                                >
                                    <TextBlock
                                        FontFamily="Segoe UI" 
                                        TextAlignment="Center"
                                        Foreground="White">
                                        <Run>useful</Run>
                                    </TextBlock>
                                </Border>
                            </Grid>
                        </VisualBrush.Visual>
                    </VisualBrush>
                </DiffuseMaterial.Brush>
            </DiffuseMaterial>
            <StaticResource ResourceKey="Specular"/>
        </MaterialGroup>
        <ScaleTransform3D x:Key="LogoScaling" ScaleZ="3.8" />
        <ScaleTransform3D x:Key="TitleScaling" ScaleZ="4.1" />
        <ScaleTransform3D x:Key="BaseScaling" ScaleZ="4.1" />
        <ScaleTransform3D x:Key="T10" ScaleZ="4.2" />
        <ScaleTransform3D x:Key="T20" ScaleZ="4" />
        <ScaleTransform3D x:Key="T30" ScaleZ="4.2" />
        <ScaleTransform3D x:Key="T40" ScaleZ="4" />
        <ScaleTransform3D x:Key="T50" ScaleZ="4.2" />
        <ScaleTransform3D x:Key="T60" ScaleZ="4" />
        <ScaleTransform3D x:Key="sphericalTransform"
            CenterX="0.5" CenterY="0.5" CenterZ="0.5"
            ScaleX="0.25" ScaleY="0.25" ScaleZ="0.25" />
        <ScaleTransform3D x:Key="compositeBarTransform"
            ScaleZ="4" />
        
    </Page.Resources>
    <TabControl Style="{StaticResource SkinedTabControl}">
        <TabItem 
            Header="Space3D">
            <p:Workshop3D Width="1200" Height="750">
                <p:Space3D>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="0" p:Space3D.Y="0" p:Space3D.Z="0"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="0" p:Space3D.Y="0" p:Space3D.Z="1"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="1" p:Space3D.Y="0" p:Space3D.Z="1"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="1" p:Space3D.Y="0" p:Space3D.Z="0"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="0" p:Space3D.Y="1" p:Space3D.Z="0"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="0" p:Space3D.Y="1" p:Space3D.Z="1"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="1" p:Space3D.Y="1" p:Space3D.Z="1"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                    <p:Spherical3D ParallelCount="40" 
                        p:Space3D.X="1" p:Space3D.Y="1" p:Space3D.Z="0"                      
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource sphericalTransform}"/>
                </p:Space3D>
            </p:Workshop3D>
        </TabItem>
        <TabItem 
            Header="Space3D + CompositeBar3D">
            <p:Workshop3D Name="gridScene" Width="1200" Height="750" DefaultLighting="False">
                <p:Workshop3D.Camera >
                    <PerspectiveCamera Position="0, 0, 12" FieldOfView="70" LookDirection="0, 0, -1">
                        <PerspectiveCamera.Transform>
                            <ScaleTransform3D ScaleX="0.92" ScaleY="0.92" ScaleZ="0.92" />
                        </PerspectiveCamera.Transform>
                    </PerspectiveCamera>
                </p:Workshop3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <Model3DGroup>
                            <DirectionalLight Color="White" Direction="0.0, -1.0, 1.0" />
                            <DirectionalLight Color="White" Direction="-1.0, -1.0, -1.0" />
                            <DirectionalLight Color="White" Direction="1.0, -1.0, -1.0" />
                            <DirectionalLight Color="White" Direction="0.0, 1.0, 0.0" />
                        </Model3DGroup>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <p:Space3D x:Name="grid">
                    <p:CompositeBar3D 
                        p:Space3D.X="-2" p:Space3D.Y="2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource NewYear1Material}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="0" p:Space3D.Y="2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"                        
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource NewYear2Material}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="4" p:Space3D.Y="-2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource SignMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="2" p:Space3D.Y="2" 
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource UsefulMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="2" p:Space3D.Y="0"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource InnoMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="2" p:Space3D.Y="-2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource AttractiveMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="0" p:Space3D.Y="-2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"                        
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource CompMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="-2" p:Space3D.Y="-2"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource RefMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="-2" p:Space3D.Y="0"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource RoiMaterial}" />
                    <p:CompositeBar3D 
                        p:Space3D.X="0" p:Space3D.Y="0"
                        DefaultTextureMapping="True"
                        RoundingRate="0.2"
                        SideCount="12"                        
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource compositeBarTransform}"
                        EndMaterial="{StaticResource LogoMaterial}" />
                </p:Space3D>
            </p:Workshop3D>
        </TabItem>
        <TabItem 
            Header="BeeSpace3D + BeeBar3D">
            <p:Workshop3D Name="scene" Width="1200" Height="750" DefaultLighting="False" ShowCommandPanel="False">
                <p:Workshop3D.Camera >
                    <PerspectiveCamera Position="-2.1, 1, 8.6" FieldOfView="90" LookDirection="0.25, 0, -1">
                        <PerspectiveCamera.Transform>
                            <ScaleTransform3D ScaleX="0.92" ScaleY="0.92" ScaleZ="0.92" />
                        </PerspectiveCamera.Transform>
                    </PerspectiveCamera>
                </p:Workshop3D.Camera>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <Model3DGroup>
                            <DirectionalLight Color="White" Direction="0.0, -1.0, 1.0" />
                            <DirectionalLight Color="White" Direction="-1.0, -1.0, -1.0" />
                            <DirectionalLight Color="White" Direction="1.0, -1.0, -1.0" />
                            <DirectionalLight Color="White" Direction="0.0, 1.0, 0.0" />
                        </Model3DGroup>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <p:BeeSpace3D x:Name="beeGrid">
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="-2" p:BeeSpace3D.Y="2"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource TitleScaling}"
                        EndMaterial="{StaticResource NewYear1Material}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="-1" p:BeeSpace3D.Y="1"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource TitleScaling}"
                        EndMaterial="{StaticResource NewYear2Material}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="-2" p:BeeSpace3D.Y="1"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource BaseScaling}"
                        EndMaterial="{StaticResource SignMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="0" p:BeeSpace3D.Y="1" 
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T10}"
                        EndMaterial="{StaticResource UsefulMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="1" p:BeeSpace3D.Y="1"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T20}"
                        EndMaterial="{StaticResource InnoMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="2" p:BeeSpace3D.Y="0"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T30}"
                        EndMaterial="{StaticResource AttractiveMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="2" p:BeeSpace3D.Y="-1"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T40}"
                        EndMaterial="{StaticResource CompMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="1" p:BeeSpace3D.Y="-1"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T50}"
                        EndMaterial="{StaticResource RefMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="0" p:BeeSpace3D.Y="0"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource T60}"
                        EndMaterial="{StaticResource RoiMaterial}" />
                    <p:BeeBar3D 
                        p:BeeSpace3D.X="1" p:BeeSpace3D.Y="0"
                        Material="{StaticResource SideMaterial}"
                        Transform="{StaticResource LogoScaling}"
                        EndMaterial="{StaticResource LogoMaterial}" />
                </p:BeeSpace3D>
            </p:Workshop3D>
        </TabItem>
    </TabControl>
</Page>
